package io.jt808.proto.item;


import io.norland.buffer.AutoBuffer;
import io.norland.proto.IProto;

public final class PositionAdditionalFactory {
    public static IProto create(int additionalId, AutoBuffer buffer) {
        IProto additional = null;
        switch (additionalId) {
            case 0x01:
                additional = new PositionAdditional01Mileage();
                additional.readFromBuf(buffer);
                break;
            case 0x02:
                additional = new PositionAdditional02Oil();
                additional.readFromBuf(buffer);
                break;
            case 0x03:
                additional = new PositionAdditional03RecorderSpeed();
                additional.readFromBuf(buffer);
                break;
            case 0x04:
                additional = new PositionAdditional04AlarmEventId();
                additional.readFromBuf(buffer);
                break;
            case 0x11:
                additional = new PositionAdditional11OverSpeedAlarmAdditional();
                additional.readFromBuf(buffer);
                break;
            case 0x12:
                additional = new PositionAdditional12InOutAreaAlarmAdditional();
                additional.readFromBuf(buffer);
                break;
            case 0x13:
                additional = new PositionAdditional13RouteDriveTimeAlarmAdditional();
                additional.readFromBuf(buffer);
            case 0x25:
                additional = new PositionAdditional25Signal();
                additional.readFromBuf(buffer);
                break;
            case 0x2A:
                additional = new PositionAdditional2AIoStatus();
                additional.readFromBuf(buffer);
                break;
            case 0x2B:
                additional = new PositionAdditional2BAnalog();
                additional.readFromBuf(buffer);
                break;
            case 0x30:
                additional = new PositionAdditional30NetworkSignalStrength();
                additional.readFromBuf(buffer);
                break;
            case 0x31:
                additional = new PositionAdditional31GNSS();
                additional.readFromBuf(buffer);
                break;
            case 0xE0:
                additional = new PositionAdditionalE0FollowedBytesLength();
                additional.readFromBuf(buffer);
                break;
        }
        return additional;
    }
}